package com.tuobuxie.entity;
// Generated 2016-11-24 15:23:31 by Hibernate Tools 4.3.4.Final

import java.math.BigDecimal;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

import com.alibaba.fastjson.JSON;


/**
 * TShoppingCart generated by hbm2java
 */
@Entity
@Table(name = "T_ITEM", schema = "TUOBUXIE")
public class TItem implements java.io.Serializable {

	private Integer CId;
	private BigDecimal CGoodsId;
	private BigDecimal CQuantity;
	private TGoods tGoods;
	private TShoppingCart tShoppingCart;

	public void settGoods(TGoods tGoods) {
		this.tGoods = tGoods;
	}

	@ManyToOne()
	public TGoods gettGoods() {
		return tGoods;
	}

	@ManyToOne()
	public TShoppingCart gettShoppingCart() {
		return tShoppingCart;
	}

	public void settShoppingCart(TShoppingCart tShoppingCart) {
		this.tShoppingCart = tShoppingCart;
	}

	public TItem() {
	}
	public TItem(Integer CId) {
		this.CId = CId;
	}

	public TItem(Integer CId, BigDecimal CGoodsId, BigDecimal CQuantity) {
		this.CId = CId;
		this.CGoodsId = CGoodsId;
		this.CQuantity = CQuantity;
	}

	@Id
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="S_TItem")
	@SequenceGenerator(name="S_TItem", allocationSize=1, initialValue=1,sequenceName="S_TItem")
	@Column(name = "ID", unique = true, nullable = false, precision = 22, scale = 0)
	public Integer getCId() {
		return this.CId;
	}

	public void setCId(Integer CId) {
		this.CId = CId;
	}

	@Column(name = "GOODS_ID", precision = 22, scale = 0)
	public BigDecimal getCGoodsId() {
		return this.CGoodsId;
	}

	public void setCGoodsId(BigDecimal CGoodsId) {
		this.CGoodsId = CGoodsId;
	}

	@Column(name = "QUANTITY", precision = 22, scale = 0)
	public BigDecimal getCQuantity() {
		return this.CQuantity;
	}

	public void setCQuantity(BigDecimal CQuantity) {
		this.CQuantity = CQuantity;
	}
	@Override
	public String toString() {

		return JSON.toJSONString(this);
	}
}